﻿<extend name="Public:base" />
<block name="title"><title>{$prjInfo.name}-般若虾</title></block>
<block name="header_styles">
    <style type="text/css">
        .link-favorite {
            position: relative;
            z-index: 9;
        }
    </style>
</block>
<block name="main">
    <div class="row">
        <div class="col-xs-9">
            <div class="column-main">
                <div class="basic">
                    <div class="basic-info-title">
                        <if condition="$prjInfo.state neq 0">
                            <div class="pull-right project-like">
                                <span class="tuo-guang <gt name='prjInfo.moneyin' value='0'>active</gt>">{$prjInfo.moneyin|toTuoguanDesc}</span>
                            </div>
                        </if>
                        {$prjInfo.tname}
                    </div>
                    <if condition="$prjInfo.state eq 0">
                        <h1 style=" margin-top: 30px;text-align: center;color: #a0a0a0;font-size: 2.0em;">很遗憾，该项目已被删除~</h1>
                        <else />
                        <div class="basic-info-sub-title">
                            项目概要
                        </div>
                        <div class="solution-description">
                            {$prjInfo.abstract|htmlspecialchars_decode}
                            {$prjInfo.guihua}
                            {$prjInfo.benefit}
                        </div>
                    </if>
                </div>
            </div>
        </div>

        <div class="col-xs-3">
            <div class="row" style="padding-bottom: 10px;">
                <div class="col-xs-12">
                    <a <if condition="$jobTotal neq 0">href="{$pid|genJobURL}"<else/>href="#" style="background-color: #e4e4e4;"</if> class="btn btn-green  col-xs-12">查看职位</a>
                </div>
            </div>

            <div class="column-sidebar">
                <div class='prjdetailsidebar-title'><p>项目所属团队</p></div>
                <if condition="$prjInfo.state gt 0">
                    <div class="widget-userinfo">
                        <div class="text-center">
                            <img src="__APP__/{$prjInfo.logo|toLogo}" alt="{$prjInfo.tname}" class="img-thumbnail" />
                        </div>
                        <br />
                        <ul class="list-project-info label-align-left">
                            <li>
                                <div class="row">
                                    <label class="col-xs-6 control-label text-right">团队名称:</label>
                                    <div class="col-xs-6">{$prjInfo.tname}</div>
                                </div>
                            </li>
                            <li>
                                <div class="row">
                                    <label class="col-xs-6 control-label text-right">创建者:</label>
                                    <div class="col-xs-6"><a href="{$prjInfo.uid|genTalentURL}">{$prjInfo.creater}</a></div>
                                </div>
                            </li>
                            <li>
                                <div class="row">
                                    <label class="col-xs-6 control-label text-right">招募席位:</label>
                                    <div class="col-xs-6">{$jobTotal}</div>
                                </div>
                            </li>
                            <li>
                                <div class="row">
                                    <label class="col-xs-6 control-label text-right">剩余席位:</label>
                                    <div class="col-xs-6">{$rest}</div>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div class="panel panel-menu">
                        <div class="panel-heading">
                            <span class="badge transparent pull-right">{$rest}/{$jobTotal}</span>
                            团队成员
                        </div>
                        <div class="panel-body">
                            <ul class="list-project-members">
                                <volist name="jobs" id="job">
                                    <if condition="$job.reserved eq 0">
                                        <li>
                                            <a href="javascript:void(0);" data-pid="{$job.pid}" data-id="{$job.id}" class="shenqing member-pic">
                                                <img src="__Public__/themes/images/fimg.png" class="img-responsive avatar-round" />
                                            </a>
                                            <div class="member-details">
                                                <div>{$job.jname}&nbsp;&nbsp;&#165;{$job.salary}</div>
                                                <div><eq name='job.applied' value='1'><a href="javascript:void(0);" class="cancelApply" data-id="{$job.id}">撤销申请</a><else /><a href="javascript:void(0);" data-pid="{$job.pid}" data-id="{$job.id}" class="shenqing">点击申请</a></eq></div>
                                            </div>
                                        </li>
                                        <else />

                                        <li>
                                            <a href="{$job.uid|genTalentURL}" class="member-pic">
                                                <img src="__APP__/{$job.photo|toTalentPhoto}" alt="{$job.uname}" width="75" height="75" class="img-responsive avatar-round" />
                                            </a>
                                            <div class="member-details">
                                                <label class="group-item-title">{$job.jname}</label><br />
                                                <label class="group-item-name"><a href="{$job.uid|genTalentURL}">{$job.uname}</a></label>
                                            </div>
                                        </li>
                                    </if>
                                </volist>
                                <empty name="jobs">
                                    <li style="width:100%;height:60px;background-color: #f0f0f0;color: #a0a0a0; text-align: center"><span>暂无职位或成员</span></li>
                                </empty>
                            </ul>
                        </div>
                    </div>
                    <div class="panel panel-menu">
                        <div class="panel-heading">
                            社交帐号
                        </div>
                        <div class="panel-body">
                            <ul>
                                <li><span>微博：{$prjInfo.weibo}</span></li>
                                <li><span>微信公众号：{$prjInfo.weixin}</span></li>
                            </ul>
                        </div>
                    </div>
                </if>
            </div>
        </div>

    </div>
    <div style="display: none;">
        <div id="tooltipcontent1" class="tooltipcontent1">
            <div style="width:300px;text-align:left;">
                {$tip}
            </div>
        </div>
    </div>
</block>
<block name="footer_scripts">
    <if condition="$account.passcheck neq 0">

        <script type="text/javascript">
            require(["jquery", "modules/message"], function ($, messageBox) {
                $(".shenqing").click(function () {
                    var pid = $(this).data("pid");
                    var id = $(this).data("id");
                    var url1 = "{:U('Project/if_ajax')}";
                    var url = "{:U('Project/sq_ajax')}";
                    $.post(url1, { 'prj': pid, 'job': id }, function (data) {
                        var vdata = eval(data);
                        if (vdata.success == 0) {
                            $.post(url, { 'prj': prj, 'job': job }, function (data2) {
                                var vdata2 = eval(data2);
                                messageBox.alert({ content: vdata2.msg });
                                return false;
                            }, 'json');
                        }
                        else if (vdata.success == 1) {
                            window.location.href = "{:U('Login/index')}";
                        }
                        else {
                            messageBox.alert({ content: vdata.msg });
                        }
                    }, 'json');
                });
            });
        </script>

        <else />
        <script type="text/javascript">
            require(["jquery", "modules/message"], function ($, messageBox) {
                //申请职位
                $(".shenqing").click(function () {
                    messageBox.alert({ content: "很遗憾，您的账号尚未通过我们的人工审核，暂时无法加入团队。您可以到<a href=\"{:U('User/info')}\" style=\"text-decoration:underline\"><b>用户中心</b></a>催促加快审核。" });
                });
            });
        </script>

    </if>
    <script type="text/javascript">
        require(["jquery", "modules/message"], function ($, messageBox) {
            //撤销申请
            $(".cancelApply").click(function () {
                var id = $(this).data("id");
                var url = "{:U('Project/cancelapply_ajax')}";
                $.post(url, { 'job': id }, function (data) {
                    var vdata = eval(data);
                    if (vdata.success == 1) {
                        messageBox.alert({ content: vdata.msg, sure: function () { window.location.reload(); } });
                    }
                    else {
                        messageBox.alert({ content: vdata.msg });
                    }

                    return false;
                }, 'json');
            });
        });
    </script>

</block>
